import java.io.Serializable;

public class Member implements Serializable {
    private static final long serialVersionUID = 1L;
    private String cardNumber; // 卡号
    private String name; // 姓名
    private int points; // 积分

    public Member(String cardNumber, String name) {
        this.cardNumber = cardNumber;
        this.name = name;
        this.points = 0; // 新会员积分初始化为0
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public String getName() {
        return name;
    }

    public int getPoints() {
        return points;
    }

    public void addPoints(int points) {
        this.points += points; // 积分累计
    }

    public void redeemPoints(int points) {
        if (points <= this.points) {
            this.points -= points; // 积分兑换
        } else {
            System.out.println("积分不足，无法兑换。");
        }
    }

    @Override
    public String toString() {
        return "会员卡号: " + cardNumber + ", 姓名: " + name + ", 积分: " + points;
    }
}
